package main

import (
	//Action "./support"
	Config "./config"
	"net/http"
	"fmt"
	"log"
	"runtime"
)
func main() {
	fmt.Println("正在启动")
	http.HandleFunc("/", bootstrap)
	http.ListenAndServe(":8080", nil)
	fmt.Println("启动失败")
}
func bootstrap(w http.ResponseWriter, r * http.Request){
	fmt.Println("debug")
	var m runtime.MemStats
	runtime.ReadMemStats(&m)
	log.Println(m.Alloc)
	log.Println(m.TotalAlloc)
	log.Println(m.Sys)
	log.Println(m.NumGC)
	path := r.URL.Path

	if path == "/favicon.ico" {
		http.NotFound(w, r)
		return
	}
	//fmt.Println(r.Proto)
	// output:HTTP/1.1
	//fmt.Println(r.TLS)
	// output: <nil>
	//fmt.Println(r.Host)
	// output: localhost:9090
	//fmt.Println()
	// output: /index?id=1
	fmt.Println(r.RequestURI)
	a := r.RequestURI
	fmt.Fprintln(w, Config.Router(a))
	//fmt.Fprintln(w, r.Form)
	//fmt.Fprintln(w, r.Method)
	//fmt.Fprintln(w, r.URL)
	//aa := r.URL
	//println(aa)
	//fmt.Fprintln(w, r.Body)
	//fmt.Fprintln(w, r.Cancel)
	//fmt.Fprintln(w, r.ContentLength)
	//fmt.Fprintln(w, r.GetBody)
	//fmt.Fprintln(w, r.Header)
	//fmt.Fprintln(w, r.Host)
	//fmt.Fprintln(w, r.RequestURI)
}


